#ifndef CAMERA_H
#define CAMERA_H

class Camera
{
public:
	Camera();
	Camera(const D3DXVECTOR3& pos, const D3DXVECTOR3& target);

	virtual ~Camera();

	void SetCamera(const D3DXVECTOR3& pos, const D3DXVECTOR3& target);
	void SetLens(float fov, float aspect, float nearPlane, float farPlane);
	void SetSpeed(float speed);
	void SetPos(const D3DXVECTOR3& pos);

	D3DXVECTOR3& GetPos();
	D3DXMATRIX& GetView();
	D3DXMATRIX& GetProj();
	D3DXVECTOR3 GetLook();
	D3DXVECTOR3 GetRight();

	void Tick(float dTime);
	void EnableCameraMovement(bool enable);
	
private:
	D3DXVECTOR3 m_Pos, m_LookAt, m_Up;
	float m_Speed;
	D3DXMATRIX m_View, m_Proj;
	bool m_EnableMov;

	void Move(const D3DXVECTOR3& tran);
	void Rotate(float pitch, float yaw);
	void BuildView();
	void BuildProj();

	float m_Fov, m_Aspect, m_NearPlane, m_FarPlane;

	Camera(const Camera &t);
	Camera& operator= (const Camera &t);
};
#endif